//
// Created by Administrator on 2021/10/20.
//
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <climits>

using namespace std;

class Solution {
public:
    /**
     * 统计负数的个数
     * 如果有0 直接return
     * @param nums
     * @return
     */
    int arraySign(vector<int> &nums) {
        int oddCount = 0;
        for (auto &x: nums) {
            if (x == 0)
                return 0;
            else if (x < 0) {
                ++oddCount;
            }
        }
        return oddCount % 2 == 1 ? -1 : 1;
    }
};

int main() {
    vector<int> nums{-1, -2, -3, -4, 3, 2, 1};
    Solution solution;
    cout << solution.arraySign(nums) << endl;
    return 0;
}
